const { ccclass, property } = cc._decorator;

export interface IRankData {
    id: number;         // 排名
    district: string;   // 省名(汉字)
    name: string;       // 省名(拼音)
    people: number;     // 上榜人数
}

@ccclass
export default class RankConfig {
    /**排行榜数据 */
    public static rankList: IRankData[] = [
        {
            id: 1,
            district: "山东",
            name: 'Shandong',
            people: 895
        },
        {
            id: 2,
            district: "北京",
            name: 'Beijing',
            people: 854
        },
        {
            id: 3,
            district: "河北",
            name: 'Hebei',
            people: 820
        },
        {
            id: 4,
            district: "河南",
            name: 'Henan',
            people: 812
        },
        {
            id: 5,
            district: "香港",
            name: 'Hong Kong',
            people: 722
        },
        {
            id: 6,
            district: "澳门",
            name: 'Macau',
            people: 697
        },
        {
            id: 7,
            district: "广西",
            name: 'Guangxi',
            people: 600
        },
        {
            id: 8,
            district: "广东",
            name: 'Guangdong',
            people: 533
        },
        {
            id: 9,
            district: "上海",
            name: 'Shanghai',
            people: 499
        },
        {
            id: 10,
            district: "湖南",
            name: 'Hunan',
            people: 495
        },
        {
            id: 11,
            district: "山西",
            name: 'Shanxi',
            people: 459
        },
        {
            id: 12,
            district: "黑龙江",
            name: 'Heilongjiang',
            people: 413
        },
        {
            id: 13,
            district: "浙江",
            name: 'Zhejiang',
            people: 391
        },
        {
            id: 14,
            district: "湖北",
            name: 'Hubei',
            people: 341
        },
        {
            id: 15,
            district: "台湾",
            name: 'Taiwan',
            people: 332
        },
        {
            id: 16,
            district: "安徽",
            name: 'Anhui',
            people: 312
        },
        {
            id: 17,
            district: "福建",
            name: 'Fujian',
            people: 302
        },
        {
            id: 18,
            district: "内蒙古",
            name: 'Inner Mongolia',
            people: 291
        },
        {
            id: 19,
            district: "云南",
            name: 'Yunnan',
            people: 281
        },
        {
            id: 20,
            district: "四川",
            name: 'Sichuan',
            people: 275
        },
        {
            id: 21,
            district: "陕西",
            name: 'Shaanxi',
            people: 261
        },
        {
            id: 22,
            district: "江西",
            name: 'Jiangxi',
            people: 258
        },
        {
            id: 23,
            district: "江苏",
            name: 'Jiangsu',
            people: 250
        },
        {
            id: 24,
            district: "新疆",
            name: 'Xinjiang',
            people: 254
        },
        {
            id: 25,
            district: "吉林",
            name: 'Jiling',
            people: 231
        },
        {
            id: 26,
            district: "天津",
            name: 'Tianjin',
            people: 221
        },
        {
            id: 27,
            district: "青海",
            name: 'Qinghai',
            people: 211
        },
        {
            id: 28,
            district: "海南",
            name: 'Hainan',
            people: 203
        },
        {
            id: 29,
            district: "辽宁",
            name: 'Liaoning',
            people: 194
        },
        {
            id: 30,
            district: "贵州",
            name: 'Guizhou',
            people: 189
        },
        {
            id: 31,
            district: "西藏",
            name: 'Tibet',
            people: 184
        },
        {
            id: 32,
            district: "甘肃",
            name: 'Gansu',
            people: 179
        },
        {
            id: 33,
            district: "宁夏",
            name: 'Ningxia',
            people: 165
        },
        {
            id: 34,
            district: "重庆",
            name: 'Chongqing',
            people: 141
        },
    ]

    // /** 每天凌晨重置一些数据 */
    // private resetSomeData() {
    //     const day = 1000 * 60 * 60 * 24;
    //     const firstTime = 1732809600000;
    //     const todayTime = this.getTimeStamp();
    //     const lastLoginTime = Tools.getStorage('lastLoginTime') || firstTime;
    //     if (todayTime - lastLoginTime >= day) {
    //         Tools.setStorage('lastLoginTime', todayTime);
    //         Tools.setStorage('loginDay', (todayTime - firstTime) / day);
    //     }
    // }

    // private getTimeStamp(value: number = 0) {
    //     const now = Date.now();
    //     const today = new Date(now);
    //     today.setDate(today.getDate() + value);
    //     today.setHours(0, 0, 0, 0);
    //     return today.getTime();
    // }
}